<%@ page pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<jsp:include page="../../common/header.jsp"/>

<%@ taglib prefix="spring" uri="http://www.springframework.org/tags"%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<script type="text/javascript">
//返回到点击权限管理列表
function backmenupurlist(id){
	$("#back_form").submit();
}

function check() {  
	 document.getElementById('ok').disabled = 'disabled';  
	} 
</script>
</head>
<body class="page-header-fixed page-full-width">


	<!-- content -->
		<div class="page-content">
			
		
				<div class="container-fluid">
				
				<p></p>
				
				<div class="portlet-body form">
					<c:if test="${success==false}">
						<div class="alert alert-failure">
							<button class="close" data-dismiss="alert"></button>
							<strong><spring:message code="failure"></spring:message>!</strong>
							${errorMsg}
						</div>
					</c:if>

					<c:if test="${success }">
						<div class="alert alert-success">
							<button class="close" data-dismiss="alert"></button>
							<strong><spring:message code="success"></spring:message>!</strong>
							<spring:message code="save success"></spring:message>
							!
						</div>
					</c:if>

					<h3 class="page-title">
								<c:if test="${syspurview.sysPurviewId==null }"><spring:message code="btn.common.add.purview"></spring:message></c:if>
								<c:if test="${syspurview.sysPurviewId!=null }"><spring:message code="btn.common.edit.purview"></spring:message></c:if>
								</h3>
								
									<form action="<c:if test="${syspurview.sysPurviewId==null }">add</c:if>
								<c:if test="${syspurview.sysPurviewId!=null }">edit</c:if>" 
								method="post" class="form-horizontal" id="menupurform" onsubmit="return check();">
								<input type="hidden" name="id" value="${syspurview.sysPurviewId }" id="hiddenId"></input>
								<input type="hidden" name="parentid" value="${syspurview.parentid }" id="hiddenpId"></input>
								<input type="hidden" name="token" value="${token}"></input>
								<input type="hidden" name="menuId" value="${menuId}"/>
								<input type="hidden" name="menParentId" value="${menParentId }"/>
								<div class="control-group">
								<label class="control-label"><spring:message code="purview name"></spring:message>：</label>
								
								<div class="controls"> 
								
								<input type="text" maxLength="30"  placeholder="请输入权限名称" required <c:if test="${syspurview.sysPurviewId!=null }">disabled="disabled"</c:if> name="spurname" value="${syspurview.spurname}" class="m-wrap"/>
								<c:if test="${syspurview.sysPurviewId!=null }">
								
								<input type="hidden" name="spurname" value="${syspurview.spurname}"></input>
								</c:if>
								
								<span class="help-inline"></span>
								</div>
								</div>
								<div class="control-group">
				
												<label class="control-label"><spring:message code="access path"></spring:message>：</label>
				
												<div class="controls">
				
													<input type="text" style="width:600px" maxlength="300" name="surlpath" value="${syspurview.surlpath}"  placeholder="请输入访问路径" required class="m-wrap" />
				
													<span class="help-inline"></span>
				
												</div>
				
											</div>
											
											
											<div class="control-group">
				
												<label class="control-label"><spring:message code="purview description"></spring:message>：</label>
				
												<div class="controls">
				
													<input type="text" style="width:600px" maxlength="30" name="sdescription" placeholder="请输入权限说明" required value="${syspurview.sdescription}"  class="m-wrap" />
				
													<span class="help-inline"></span>
				
												</div>
				
											</div>
											
											
											<div class="form-actions">
				
														<button type="submit" class="btn blue" id="ok"><spring:message
													code="btn.common.save"></spring:message></button>
				
														<button type="button" onclick="backmenupurlist('${syspurview.parentid }');" class="btn"><spring:message
													code="btn.common.back"></spring:message></button>
				
										 </div>
								</form>
								
								<!-- 返回到权限列表 -->
								<form id="back_form" action="<%=request.getContextPath() %>/sys/menu-purview/list">
									<input type="hidden" name="parentid" value="${menuId}"/>
									<input type="hidden" name="menParentId" value="${menParentId }"/>
								</form>
								
				</div>
				
				</div>
				</div>

</body>
</html>